<form action="/BoxSns/Home/Index/addTopic" id="addTopic" class="mgt10"  data-type="ajaxSubmit" method="post" >
	<volist name="params['form']"   id="vo">
		<input type="hidden" name="<{$key}>" value="<{$vo}>" />
	</volist>
	<input type="hidden" name="type" value="<{$params['type']}>" />
	<div class="form-item">
		<input type="text" placeholder="标题" class="topic_title" name="title">
	</div>
	<div class="form-item">
	<textarea style="width:100%" class="contentQuestion" name="content" data-type="kindeditor" placeholder="正文" ></textarea>	 
	</div>
	<div class="form-item">
		<div data-type="upload" upload="8"></div>
	</div>
   <div class="form-item-btn">
	<button type="button" class="btn colse btn-default btn-large a_bnt">取消</button>
	<button id="btnAsk" type="submit" class="btn  btn-success btn-large a_bnt">提问</button>
	</div>
</form>


<script type="text/html" id="addAnswerListItemHtml">
<div>
    <li style="padding:10px 0px; margin-top:0px" class="media media-id-{{items.id}}">   
                  <div class="media-body">
                    <p class="media-heading">
                      
                      <a  href="/Ask/topic/topic_id/{{items.id}}" class="topic-list-title" target="_blank">{{items.title}}</a>
                     <!-- <span class="f12 muted pull-right"><{$vo.time_tran}></span>-->
                    </p>
                  
                                       <span class="f12 muted">
                                        <a style="margin-left:0px;" href="/User/index/user_id/{{items.user_id}}"  data-type="none"  target="_blank" class="avatar" >
                    <img style=" height:20px; width:20px" src="{{items.user.headimg}}">
                  </a>
                                        最后回复： {{items['lastPostName']?items['lastPostName']:"暂无"}}&nbsp; {{items.time_tran}}</span>
                                       
                    <div class="a-info pull-right f12">           
                      <span class=" read_num" title="阅读数"><i class="glyphicon glyphicon-new-window"></i> {{items.hit_count}}</span>&nbsp;
                      <span class=" read_num" title="评论数"><i class="glyphicon glyphicon-comment"></i> {{items.comment_count}}</span>
                     <!-- <span class="icons praise_num" title="点赞数"><i></i>18</span>-->
                    </div>
                  </div>
  </li>
</div>
</script>


<script type="text/javascript">
$(".topic_title").focus();
 	$("#addTopic").on("ajaxSubmitSuccess",function(e,content){
		 var data= JSON.parse(content);
		 if(data.error>0){
			 hiApp.alert(data.msg)
		}else{
			hiApp.alert("发布成功");
			 hiApp.hide_popup();
			  var answerList=$(".page").find("#answerList");
			  $(".contentQuestion").val("");
			  $(".topic_title").val("");
			  //$(".photoList-content").find("li").not(".add-image").remove();
			 // $("#contentQuestion").trigger("kindeditorChange");
			 box_render(data.msg,$("#addAnswerListItemHtml").html(),answerList,"prepend");
		}
		
	})
 </script>